package com.esl.service.admin.impl;

import org.springframework.stereotype.Service;

import com.esl.dao.admin.ResourceDao;
import com.esl.dto.admin.PageInfo_Dto;
import com.esl.model.admin.Resource;
import com.esl.service.admin.ResourceManager;

@Service("resourceManager")
public class ResourceManagerImpl implements ResourceManager {
	private ResourceDao resourceDao;

	@Override
	public void add(Resource resource) {
		resourceDao.save(resource);
	}

	@Override
	public void delect(Resource resource) {

	}

	@Override
	public void modify(Resource resource) {
		resourceDao.saveOrUpdate(resource);
	}

	@Override
	public void output() {

	}

	@Override
	public PageInfo_Dto load(int pageNow, int pageSize, String hql,
			String orderBy) {
		return resourceDao.findByPageInfo(Resource.class, pageNow, pageSize,
				hql, orderBy);
	}

	@Override
	public Resource check(String id) {
		return resourceDao.findById(Resource.class, id);
		
	}
	/*-------------------------------*/
	@javax.annotation.Resource
	public void setResourceDao(ResourceDao resourceDao) {
		this.resourceDao = resourceDao;
	}

	

}
